package com.daiyang.campus_lucky_draw.common.exception;

import com.daiyang.campus_lucky_draw.common.error.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)

public class ControllerException extends RuntimeException {
    /**
     * 业务错误码
     *
     * @see com.daiyang.campus_lucky_draw.common.error.ControllerErrorCodeConstants
     */
    private Integer code;
    /**
     * 错误提⽰
     */
    private String message;
    public ControllerException() {
    }
    public ControllerException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.message = errorCode.getMsg();
    }
    public ControllerException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
